<template>
	
	<div class="app">
		 <v-scroll :on-infinite="onInfinite">
		<div class="mui-content" style="background-color:#fff">
		    <ul class="mui-table-view mui-grid-view">
		    	
		        <li class="mui-table-view-cell mui-media mui-col-xs-6" v-for="item in goods" >
		            <router-link :to='"/goods/"+item.id'>
		                <img class="mui-media-object" :src="item.img_url">
		                <div class="mui-media-body" v-text="item.title"></div>
		            </router-link>
		        </li>
		                
		    </ul>    
		</div>
		</v-scroll>
	</div>
	
</template>

<script>

	import  commit  from "../../kits/commit.js"
	import  Scroll  from "../puclicson/downf5.vue"
	export default{
		data(){
			return{
				  page : 1, //默认已经显示出15条数据 count等于一是让从16条开始加载
			      
				  goods:[]
			}
		},
		created(){
			this.getart(this.page)
		},
		methods:{
			getart(page){
				var url = commit.api + "/api/getgoods?pageindex="+page;
				this.$http.get(url).then(res=>{
					this.goods = this.goods.concat(res.body.message);
				},res=>{
					console.log("数据获取失败")
				})
			},
			onInfinite(done) {
				this.page++
				this.getart(this.page)
				
			}
		},
		 components : {
			'v-scroll': Scroll
			  }
	}
</script>

<style scoped>


</style>